From 8b44283f8e81a010a1b6683581a9540552af50e7 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 17 Sep 2002 15:08:55 +0000 Subject: [PATCH] Call deinit functions. Magproto: only deinit termio if we initted termio. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@71 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/Makefile | 2 +- gpsbabel/magproto.c | 4 +++- gpsbabel/main.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gpsbabel/Makefile b/gpsbabel/Makefile index 4282abfdb..1aac929d1 100644 --- a/gpsbabel/Makefile +++ b/gpsbabel/Makefile @@ -2,7 +2,7 @@ CFLAGS=-g -Icoldsync FMTS=magproto.o gpx.o geo.o gpsman.o mapsend.o mapsource.o \ gpsutil.o tiger.o pcx.o csv.o cetus.o gpspilot.o magnav.o \ - psp.o mxf.o + psp.o mxf.o holux.o OBJS=main.o queue.o route.o waypt.o util.o vecs.o mkshort.o \ coldsync/util.o coldsync/pdb.o $(FMTS) diff --git a/gpsbabel/magproto.c b/gpsbabel/magproto.c index c84c0197f..fd1444afe 100644 --- a/gpsbabel/magproto.c +++ b/gpsbabel/magproto.c @@ -472,7 +472,9 @@ terminit(const char *portname) static void termdeinit() { - tcsetattr(magfd, TCSANOW, &orig_tio); + if (!is_file) { + tcsetattr(magfd, TCSANOW, &orig_tio); + } } char * diff --git a/gpsbabel/main.c b/gpsbabel/main.c index dc58d66a9..8976b7e21 100644 --- a/gpsbabel/main.c +++ b/gpsbabel/main.c @@ -80,6 +80,7 @@ main(int argc, char *argv[]) } ivecs->rd_init(fname); ivecs->read(); + ivecs->rd_deinit(); break; case 'F': ofname = optarg; @@ -87,6 +88,7 @@ main(int argc, char *argv[]) if (ovecs) { ovecs->wr_init(ofname); ovecs->write(); + ovecs->rd_deinit(); } break; case 's': -- 2.30.2